﻿@using Xunit;
@inherits TestContext
@code
{
    [Inject]
    private LibraryConfiguration LibraryConfiguration { get; set; } = new LibraryConfiguration();

    public FluentInputLabelTests()
    {
        JSInterop.Mode = JSRuntimeMode.Loose;
        Services.AddSingleton(LibraryConfiguration);
    }

    [Fact]
    public void FluentInputLabel_Default()
    {
        // Arrange && Act
        var cut = Render(@<FluentInputLabel ForId="abc" Label="My label" />);

        // Assert
        cut.Verify();
    }

    [Fact]
    public void FluentInputLabel_Required()
    {
        // Arrange && Act
        var cut = Render(@<FluentInputLabel ForId="abc" Label="My label" Required="true" />);

        // Assert
        cut.Verify();
    }

    [Fact]
    public void FluentInputLabel_AriaLabel()
    {
        // Arrange && Act
        var cut = Render(@<FluentInputLabel ForId="abc" Label="My label" AriaLabel="My ARIA label" />);

        // Assert
        cut.Verify();
    }

    [Fact]
    public void FluentInputLabel_AdditionalProperties()
    {
        // Arrange && Act
        var additionalAttributes = new Dictionary<string, object>
        {
            { "data-label", "datavalue" }
        };
        var cut = Render(@<FluentInputLabel ForId="abc" Label="My label" AdditionalAttributes="@additionalAttributes" />);

        // Assert
        cut.Verify();
    }

    [Fact]
    public void FluentInputLabel_Orientation()
    {
        // Arrange && Act
        var cut = Render(@<FluentInputLabel ForId="abc" Label="My label" Orientation="@Orientation.Horizontal" />);

        // Assert
        cut.Verify();
    }
}
